package com.sogoodsoft.entity.crm;


import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.sogoodsoft.entity.IdEntity;

/**
  *ORDER_DETAIL对象模型
  */
@Entity
@Table(name = "ORDER_DETAIL")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class OrderDetail extends IdEntity  implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

/** 订单ID */
private Long orderid;
/** 商品ID */
private Long goodsid;
/** 商品全称 */
private String goodsname;
/** 商品型号 */
private String goodsmodel;
/** 单位 */
private String goodsunit;
/** 单价 */
private double goodsprice;
/** 数量 */
private Long goodscount;
/** 金额小计 */
private double goodscash;

private OrderForm order;

/**
*获取订单ID
*@return 订单ID
*/
@Column(name = "ORDERID",insertable=false,updatable=false)
public Long getOrderid() {
return this.orderid;
}
/**
设置订单ID
*@param orderid 订单ID
*/
public void setOrderid(Long orderid) {
this.orderid = orderid;
}
/**
*获取商品ID
*@return 商品ID
*/
@Column(name = "GOODSID")
public Long getGoodsid() {
return this.goodsid;
}
/**
设置商品ID
*@param goodsid 商品ID
*/
public void setGoodsid(Long goodsid) {
this.goodsid = goodsid;
}
/**
*获取商品全称
*@return 商品全称
*/
@Column(name = "GOODSNAME")
public String getGoodsname() {
return this.goodsname;
}
/**
设置商品全称
*@param goodsname 商品全称
*/
public void setGoodsname(String goodsname) {
this.goodsname = goodsname;
}
/**
*获取商品型号
*@return 商品型号
*/
@Column(name = "GOODSMODEL")
public String getGoodsmodel() {
return this.goodsmodel;
}
/**
设置商品型号
*@param goodsmodel 商品型号
*/
public void setGoodsmodel(String goodsmodel) {
this.goodsmodel = goodsmodel;
}
/**
*获取单位
*@return 单位
*/
@Column(name = "GOODSUNIT")
public String getGoodsunit() {
return this.goodsunit;
}
/**
设置单位
*@param goodsunit 单位
*/
public void setGoodsunit(String goodsunit) {
this.goodsunit = goodsunit;
}
/**
*获取单价
*@return 单价
*/
@Column(name = "GOODSPRICE")
public double getGoodsprice() {
return this.goodsprice;
}
/**
设置单价
*@param goodsprice 单价
*/
public void setGoodsprice(double goodsprice) {
this.goodsprice = goodsprice;
}
/**
*获取数量
*@return 数量
*/
@Column(name = "GOODSCOUNT")
public Long getGoodscount() {
return this.goodscount;
}
/**
设置数量
*@param goodscount 数量
*/
public void setGoodscount(Long goodscount) {
this.goodscount = goodscount;
}
/**
*获取金额小计
*@return 金额小计
*/
@Column(name = "GOODSCASH")
public double getGoodscash() {
return this.goodscash;
}
/**
设置金额小计
*@param goodscash 金额小计
*/
public void setGoodscash(double goodscash) {
this.goodscash = goodscash;
}

@ManyToOne(cascade={CascadeType.REFRESH,CascadeType.MERGE},optional=true)
@JoinColumn(name="ORDERID")
public OrderForm getOrder() {
	return order;
}
public void setOrder(OrderForm order) {
	this.order = order;
}


}